{include file='header.tpl'}

<p>Lease a match server courtesy of us to conduct your Digital Paint: Paintball 2
matches.</p>

<form action="{$form_action|escape:'html'}" method="post">
    <h2>Server Settings</h2>
    
    <table border="0" border="1" cellspacing="0" cellpadding="0" class="listing">
    <col width="1%" />
    <col />
    <col width="1%" />
    <col width="1%" />
    <tr>
        <th>&nbsp;</th>
        <th>Server</th>
        <th>Address</th>
        <th class="last">Status</th>
    </tr>
    {if count($enable_autoselect) eq true}
        <tr>
            <td><input type="radio" name="server" id="autoselect" value="autoselect" /></td>
            <td><label for="autoselect"><strong>Auto-select an available server</strong></label></td>
            <td>&nbsp;</td>
            <td class="last">&nbsp;</td>
        </tr>
    {/if}
    {foreach from=$servers key=i item=server}
        <tr>
            <td><input type="radio" name="server" id="server_{$i}" value="{$i}" /></td>
            <td><label for="server_{$i}">{$server.name}</label></td>
            <td><a href="paintball2://{$server.host}:{$server.port}">{$server.host}:{$server.port}</a></td>
            <td class="last"><img src="status.php?server={$i}&amp;__={0|rand:999999999}" alt="" class="status-icon" /></td>
        </tr>
    {/foreach}
    </table><br />
    
    <table border="0" border="1" cellspacing="0" cellpadding="0" class="form">
        <tr>
            <th><label for="password">Join password: </label></th>
            <td><input type="text" name="password" id="password" size="20" /></td>
        </tr>
        <tr class="last">
            <th><label for="login">Login password: </label></th>
            <td><input type="text" name="login" id="login" size="20" /></td>
        </tr>
    </table>
    
    <p>Players need the join password in order to connect, and the login password is
    reserved for your use to change the map and manage a few things on the server.</p>
    
    {if count($user_settings) gt 0}
    <h2>Gameplay variables</h2>
    
    <p>Feel free to modify the values below as you see fit. They determine the mechanics
    of the gameplay.</p>
        
    <table border="0" cellspacing="0" cellpadding="0" class="form">
        {foreach name="fr_user_settings" from=$user_settings key=cvar item=opt}
        {if $opt.only_after_lease neq true}
        <tr{if $smarty.foreach.fr_user_settings.last eq true} class="last"{/if}>
            <th><label for="var_{$cvar}"><a href="http://digitalpaint.therisenrealm.com/reference/commands#{$cvar|escape:'url'}">{$cvar}</a>:</label></th>
            <td>
                {if $opt.type eq 'int' or $opt.type eq 'float'}
                <input type="text" id="var_{$cvar}" name="var_{$cvar}" size="5"{if count($default_settings.$cvar) gt 0} value="{$default_settings.$cvar|escape:'url'}"{/if} />
                {elseif $opt.type eq 'string'}
                <input type="text" id="var_{$cvar}" name="var_{$cvar}" size="30"{if count($default_settings.$cvar) gt 0} value="{$default_settings.$cvar|escape:'url'}"{/if} />
                {elseif $opt.type eq 'bool'}
                <select id="var_{$cvar}" name="var_{$cvar}">
                    <option value="">&nbsp;</option>
                    <option value="true"{if count($default_settings.$cvar) gt 0 and $default_settings.$cvar eq 1} selected="selected"{/if}>true</option>
                    <option value="false"{if count($default_settings.$cvar) gt 0 and $default_settings.$cvar eq 0} selected="selected"{/if}>false</option>
                </select>
                {/if}
                [{$opt.type}]
            </td>
        </tr>
        {/if}
        {/foreach}
    </table>
    {/if}
    
    {if strlen($bot_check_string) gt 0}
    <br /><p>As a spam-bot check, enter the phrase <strong>{$bot_check_string|escape:'html'}</strong> into
    this field: <input type="text" name="botcheck" id="botcheck" size="20" /></p>
    {/if}
    
    <p><input type="submit" value="Lease Server" /></p>
</form>

{include file='footer.tpl'}